-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/issue 253 add active mq hosting #273
Feature/issue 253 add active mq hosting #273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice, solid starting point. There are some code style improvements I've put in as suggestions.
Also, can you add some integration tests in the pattern of https://github.com/CommunityToolkit/Aspire/blob/main/tests/CommunityToolkit.Aspire.Hosting.Meilisearch/AppHostTests.cs to verify that the hosting integration can start and that it will be able to be used.
Lastly, should there be some health checks in place?
...lkit.Aspire.Hosting.ActiveMQ.AppHost/CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost.csproj
Outdated
Show resolved
Hide resolved
...lkit.Aspire.Hosting.ActiveMQ.AppHost/CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost.csproj
Outdated
Show resolved
Hide resolved
examples/activemq/CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost/Program.cs
Outdated
Show resolved
Hide resolved
...ire.Hosting.ActiveMQ.MassTransit/CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit.csproj
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQServerResource.cs
Outdated
Show resolved
Hide resolved
I'm looking into the healthcheck and I don't know how I could implement this. Maybe I could also try to connect to the broker using the apache.NMS nuget package but I don't know if I should add this package. b.t.w. I would expect that the container itself would tell if it is healthy or not... |
d321200
to
b78ccfd
Compare
The container healthy status would be part of it, if the container is running, then it's "healthy", if it's stopped then it's "unhealthy" (well, the resource is stopped so that's an implied unhealthy status). But depending on how the app inside the container works, just having the container running may not be enough. What if the app crashes in the container but the container doesn't stop? it's "healthy" in the fact that it's running, but it's really unhealthy as you can't use the endpoint(s). If there's a HTTP endpoint that you can probe, that should do, and there's a built-in HTTP health check feature, we use it here for example: https://github.com/CommunityToolkit/Aspire/blob/main/src/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps/SwaAppHostingExtension.cs#L55 |
tests/CommunityToolkit.Aspire.Hosting.ActiveMQ.Tests/AppHostTests.cs
Outdated
Show resolved
Hide resolved
I use this comment to share my ideas about the health-check for the ActiveMQ hosting and try to help my thinking proces.
My ideas/questions:
|
I tried to add a healthcheck using the Jolokia endpoint on another branch: https://github.com/anoordover/CommunityToolkit-Aspire/tree/feature/issue_253_AddActiveMqHosting_WithHealth |
src/CommunityToolkit.Aspire.Hosting.ActiveMQ/ActiveMQServerResource.cs
Outdated
Show resolved
Hide resolved
tests/CommunityToolkit.Aspire.Hosting.ActiveMQ.Tests/AppHostTests.cs
Outdated
Show resolved
Hide resolved
Was looking at that code and thought "this looks familiar" 🤣 Yep, that looks right on how it could be done. I'd collapse a few of those methods together, since you don't really need to have something that's supporting varying parameters though. |
…Host/CommunityToolkit.Aspire.Hosting.ActiveMQ.AppHost.csproj Co-authored-by: Aaron Powell <[email protected]>
…Host/Program.cs Co-authored-by: Aaron Powell <[email protected]>
…sTransit/CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit.csproj Co-authored-by: Aaron Powell <[email protected]>
…viceDefaults/CommunityToolkit.Aspire.Hosting.ActiveMQ.ServiceDefaults.csproj Co-authored-by: Aaron Powell <[email protected]>
…tensions.cs Co-authored-by: Aaron Powell <[email protected]>
…tensions.cs Co-authored-by: Aaron Powell <[email protected]>
…tensions.cs Co-authored-by: Aaron Powell <[email protected]>
…tensions.cs Co-authored-by: Aaron Powell <[email protected]>
…tensions.cs Co-authored-by: Aaron Powell <[email protected]>
…tensions.cs Co-authored-by: Aaron Powell <[email protected]>
…r for received messages, extended integrationtest to check on recieved messages
…ource.cs Co-authored-by: Aaron Powell <[email protected]>
526f1a2
to
7736cb6
Compare
So here are my next steps in my solution:
What are your best practices about line-breaks? Can I find this somewhere in the guidelines? @aaronpowell thanks for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good there, I think it's ready to merge.
As I'm unfamiliar with this problem space, can you explain what (if any) the intersection between this and #278 would be? since I see MassTransit used in this PR.
To explain a little bit about this implementation:
Because of this I did this:
In short: The implementation only facilitates using MassTransit by exposing the configuration of the scheme being used in the connectionString. |
# Conflicts: # Directory.Packages.props
I tried to do a rebase on main but I didn't succeed in merging this way. I did an ordinary merge from main to my branch. |
**Closes #253 **
PR Checklist
Other information
I'm looking for feedback on my implementation for the ActiveMQ hosting.
Please advice me about next steps I need to make to complete this functionality.